package com.psmorandi.peschampweb.android.server.parsers;

import java.util.List;

import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

abstract class BaseParser<T> {

	protected Gson m_jsonParser;
	
	public BaseParser(){
		GsonBuilder gsonBuilder = new GsonBuilder();
		gsonBuilder.setDateFormat("yyy-MM-dd'T'HH:mm:ss");
		gsonBuilder.setFieldNamingPolicy(FieldNamingPolicy.UPPER_CAMEL_CASE);
		m_jsonParser = gsonBuilder.create();
	}
	
	public abstract T deserialize(String _json);
	public abstract List<T> deserializeList(String _json);
	public abstract String serialize(T _model);
}
